home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / others / crypt / pgp26uib / contrib / mailx / pgpmail2 / text0000.txt < prev   
Encoding:
Text File  |  1994-06-19  |  4.1 KB  |  103 lines

  1. In recent email to me you write:
  2. >Hi, folks!  The 2.3 release of PGP is coming, as they say, Real Soon Now.
  3. >If you have any changes you'd like made to scripts in the contrib part
  4. >of PGP 2.2, now is the time to send them in.
  5. >
  6. >If you want to start any work for inclusion in the release, it's
  7. >needed in roughly a week ("roughly" means maybe a day or two less!),
  8. >but write and I'll keep you informed.
  9.  
  10. Colin,
  11.  
  12. I don't know what the latest version I sent you contains, but here is
  13. the latest of what I am using.  Also, I would like to ask if the pgp
  14. maintainers have made the signal mods I have suggested repeatedly on
  15. the alt.security.pgp group:  namely, if the interrupt or quit signals
  16. are ignored on entry, then pgp leaves them ignored.  This permits running
  17. pgp as a background task under Unix.  If they have not put these changes
  18. into 2.3, let me know and I'll send the diffs to you.  They are very
  19. straightforward, simple and noncontroversial, and I'd like to see this
  20. made the standard.
  21.  
  22. Here is my latest version of "pgpmail" the script which takes the
  23. place of the standard mailer in "mailx" to perform in-line encryption.
  24. I have dropped bourne shell support entirely -- this now requires ksh
  25. to run:
  26. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  27. # This ksh script is invoked by adding the line "set sendmail=pgpmail" to your
  28. # .mailrc file.  mailx then invokes pgpmail instead of /bin/mail to deliver
  29. # email.  This script checks whether encryption, a signature, or both are
  30. # specified, and automatically performs whatever is required.
  31. #    Rob Stampfli            12 March 1993
  32.  
  33. STDSIG="John Q. Public"            # sig to use if "sig=y"
  34. trap "" 1 2 3                # req'd so this can run in bg
  35. exec 2>/dev/tty                # can be "exec 2>/dev/null"
  36. set +o nounset
  37. unset en sg nl
  38.  
  39. j=1
  40. for i                    # for each argument...
  41. do
  42.   case "$i" in                # look for encryption specifier...
  43.   *encrypt=*)    en[$j]="${i#*=}";;    # requires KSH
  44.   *enc=*)    en[$j]="${i#*=}";;    # requires KSH
  45.   *sig=*)    sg="${i#*=}";;        # a pgp signature specification...
  46.   *)        nl[$j]="$i";;        # a real mail address...
  47.   esac
  48.   ((j += 1))                # increment array counter...
  49. done
  50.  
  51. [ X = "X${en[*]}" -a X = "X$sg" ] && exec /bin/rmail "$@"   # not a pgp request
  52. [ Xy = "X$sg" -o Xyes = "X$sg" ] && sg="$STDSIG"        # std sig request
  53.  
  54. # If we get here, encryption and/or sig *was* specified:
  55. (
  56.   OIFS="$IFS"                # needed to preserve tabs in header
  57.   IFS='
  58. '
  59.   while read x                 # read and process header intact
  60.   do
  61.     echo "$x"                # echo the line...
  62.     [ X = "X$x" ] && break        # and if NULL line, break
  63.   done
  64.   IFS="$OIFS"                # reset field separators
  65.   if [ X = "X$sg" ]; then        # no signature specified:
  66.     pgp -feat "${en[@]}"        #   encrypt the message...
  67.   elif [ X = "X${en[*]}" ]; then    # no encrypt specified:
  68.     sed -e 's/^From />From /' |        #   pre-convert mail glitcher...
  69.     pgp -fast +clearsig=on -u "$sg"    #   sign msg in MIC-CLEAR mode...
  70.   else                    # both encrypt and sig specified:
  71.     pgp -feast "${en[@]}" -u "$sg"    #   encrypt and sign armored...
  72.   fi
  73.   echo "Encryption phase completed" 1>&2
  74. ) | /bin/rmail "${nl[@]}"
  75. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  76.  
  77. Here is a copy of "pgpm", which I use to decrypt pgp mail I receive.  To use,
  78. just pipe the encrypted mail message to "pgpm" and it will ask the questions,
  79. decrypt it, and remail the decrypted version back to you.  You can then delete
  80. the encrypted version and do what you like with the plaintext mail msg:
  81.  
  82. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  83. # This script is used from mailx or vi to mail invoker the decrypted input
  84. # make sure stderr comes out on screen, to undo vi bogosity
  85. exec 2>/dev/tty
  86. (
  87.     OIFS="$IFS"            # we must preserve tabs in header
  88.     IFS='
  89. '
  90.     while read x             # read and process header intact
  91.     do
  92.     echo "$x"
  93.     [ "" = "$x" ] && break
  94.     done
  95.     IFS="$OIFS"            # reset field separators
  96.     pgp ${1-}            # encrypt or decrypt the rest
  97. ) | rmail $LOGNAME
  98. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  99. -- 
  100. Rob Stampfli  rob@colnet.cmhnet.org      The neat thing about standards:
  101. 614-864-9377  HAM RADIO: kd8wk@n8jyv.oh  There are so many to choose from.
  102.  
  103.